package com.gears_software.bbnetwork.dialogs;

import com.gears_software.bbnetwork.R;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class DeleteDialog extends Dialog {

	public DeleteDialog(Context context, int theme) {
		super(context, theme);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		setContentView(R.layout.deldetedialog);
		Button dialog_confirm = (Button) findViewById(R.id.dialog_confirm);
		Button dialog_cancel = (Button) findViewById(R.id.dialog_cancel);
		dialog_confirm.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View arg0) {
				isSetOnClick.returnCode(1);
				
			}
		});
		dialog_cancel.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View arg0) {
				isSetOnClick.returnCode(2);
			}
		});
	}
	
	public interface ISetOnClick{
		public void returnCode(int type);
	}

	private ISetOnClick isSetOnClick = null;
	public void setOnClick(ISetOnClick isSetOnClick){
		this.isSetOnClick = isSetOnClick;
	}
}
